{% extends "base_generic.html" %}

{% block content %}
    <h1>Author List</h1>
    {% if object_list %}
        <ul>
            {% for object in object_list %}
                <li>
                    <a href="{{ object.get_absolute_url }}">{{ object.first_name }} {{ object.last_name }}</a>
                    {% if perms.catalog.can_mark_returned %}
                        - <a href="{% url 'author_update' object.pk %}">update</a>
                        - <a href="{% url 'author_delete' object.pk %}">delete</a>
                    {% endif %}
                </li>
            {% endfor %}
        </ul>
    {% else %}
        <p>There are no authors in the library.</p>
    {% endif %}
    {% if perms.catalog.can_mark_returned %}
        <a href="{% url 'author_create' %}">Add an author</a>
    {% endif %}
{% endblock %}